<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.css" rel="stylesheet" />
		<style>
			body{
				background: #FFFFFF;
			}
			.mui-bar{
				background: #FFFFFF;
				box-shadow: none;
			}
			a{
				color:rgba(51,51,51,1);
			}
			.seek_o{
				width:calc(78% - 15px);
				position: relative;
				float: left;
				margin-top:3px;
				margin-left:15px;
			}
			.seek_o>img{
				width:15px;
				height:15px;
				position: absolute;
				left: 14px;
				bottom: 25px;
			}
			.seek_o>input{
				width:100%;
				height:38px;
				background: rgba(245,245,245,1);
				border-radius:38px;
				padding-left:35px ;
				border:none;
			}
			::-webkit-input-placeholder{
				font-size:12px;
				font-family:PingFang-SC-Regular;
				font-weight:bold;
				color:rgba(152,152,152,1);
			}
			.seek_t{
				width:10%;
				position: relative;
				float:right;
				font-size:14px;
				font-family:PingFang-SC-Regular;
				font-weight:bold;
				color:rgba(51,51,51,1);
				line-height:35px;
			}
			.subor_two{
				width:calc(96% - 15px);
				position:relative;
				float: left;
				border-bottom:1px solid #d4d4d4;
				margin-left:15px;
				padding-top:30px;
				box-sizing:border-box;
				padding-bottom:20px;
			}
			.two_o{
				width:20%;
				position:relative;
				float:left;
			}
			.two_o>img{
				width:50px;
				height:50px;
				border-radius:50%;
			}
			.two_t{
				width:58%;
				position: relative;
				float: left;
				padding-top: 5px;
				box-sizing:border-box;
			}
			.two_t>span:nth-child(1){
				font-size:15px;
				font-family:PingFang-SC-Medium;
				font-weight:500;
				color:rgba(51,51,51,1);
			}
			.two_t>span:nth-child(2){
				font-size:15px;
				font-family:PingFang-SC-Medium;
				font-weight:500;
				color:rgba(153,153,153,1);
				padding-left:5px;
				box-sizing:border-box;
			}
			.two_t>p{
				font-size:13px;
				font-family:PingFang-SC-Medium;
				font-weight:500;
				color:rgba(153,153,153,1);
			}
			.two_th{
				width:22%;
				position: relative;	
				float: left;
				margin-top: 7px;
				box-sizing:border-box;
			}
			.two_th>button{
				width:83.5px;
				height:35px;
				background:linear-gradient(180deg,rgba(252,126,119,1) 0%,rgba(254,96,93,1) 100%);
				box-shadow:0px 5px 8px 0px rgba(254, 95, 99, 0.35);
				border-radius:35px;
				font-size:15px;
				font-family:PingFang-SC-Bold;
				font-weight:bold;
				color:rgba(255,255,255,1);
			}
		</style>
	</head>
		
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<div class="seek_o">
				<img src="../image/sou.png" alt="">
				<input id="tiaojian" type="text" placeholder="输入合伙人的电话号码">
			</div>
			<h5 class="seek_t">搜索</h5>
		</header>
		<div class="mui-content">
			<!-- <div class="subor_two">
				<div class="two_o">
					<img src="../image/touxiang.png" alt="">
				</div>
				<div class="two_t">
					<span>陈雪</span>
					<span>13522646689</span>
					<p>还可开启15天会员</p>
				</div>
				<div class="two_th">
					<button>续费</button>
				</div>
			</div> -->
		</div>
		<script src="../js/mui.js"></script>
		<script src="../js/jquery-3.1.1.min.js"></script>
		<script type="text/javascript">
			mui.plusReady(function(){
				var url = plus.storage.getItem('url');
				var user = plus.storage.getItem('user');
				user = JSON.parse(user);
				mui.init({
				        beforeback: function() {　　 
				            //获得父页面的webview
				            var list = plus.webview.currentWebview().opener();　　
				            //触发父页面的自定义事件(refresh),从而进行刷新
				            mui.fire(list, 'refresh');
				            //返回true,继续页面关闭逻辑
				            return true;
				        }
				    });
				mui('.mui-bar').on('tap','.seek_t',function(){
					var tiaojian = $("#tiaojian").val();
					plus.nativeUI.showWaiting();
					mui.post(url+'/juyou/index/getuser',{token:user.token,tiaojian:tiaojian},function(res){
						plus.nativeUI.closeWaiting();
						mui.toast(res.msg);
						if(res.code==200){
							var str = '';
							mui.each(res.data,function(i,v){
								str+='<div class="subor_two">'+
									'<div class="two_o">'+
										'<img src="'+v.touxiang+'" alt="">'+
									'</div>'+
									'<div class="two_t">'+
										'<span>'+v.name+'</span>'+
										'<span>'+v.user+'</span>';
										if(v.huiyuan>0){
											str+='<p>用户还在会员期内</p>'+
												'</div>'+
											'</div>';
										}else{
											str+='<p>可续费会员</p>'+
												'</div>'+
												'<div class="two_th">'+
													'<button data-user="'+v.id+'">续费</button>'+
												'</div>'+
											'</div>';
										}
										
							})
							$('.mui-content').empty();
							$('.mui-content').append(str);
							mui('.two_th').on('tap','button',function(e){
								var userid = $(this).attr('data-user');
								e.detail.gesture.preventDefault();
								var btnArray = ['取消', '确定'];
								mui.prompt('请输入续费天数(一次)：', '30', '提示', btnArray, function(e) {
								 if (e.index == 1) {
									var str = e.value;
									if(str>30){
										mui.toast('最多可以续费30天');
										return
									}
									plus.nativeUI.showWaiting();
									$.post(url+'/juyou/hehuo/renew_member',{token:user.token,userid:userid,number:str},function(res){
										plus.nativeUI.closeWaiting();
										mui.toast(res.msg);
										if(res.code==200){
											setTimeout(function(){
												mui.back();
											},1500)
										}
									})
								 }
								})
							})
						}
					})
					
				})
			})
			
		</script>
	</body>

</html>
